/*
 * 累加存值
 */			
var yongyaofanan = {
	getItem:function(){
		return JSON.parse(window.localStorage.getItem('yongyaofanan'))||{};//取值
	},
	setItem:function(item){
		window.localStorage.setItem('yongyaofanan',JSON.stringify(item));//存值
		ObjAll = item;
	},
	update:function(key,value){
		var item = this.getItem();
		item[key] = value;
		this.setItem(item);
	}
}


/*
 * 跳转页面
 */
function showpage(x, y) {
	mui.openWindow({
		url: x,
		id: y,
		preload: true,
		show: {
			aniShow: 'pop-in'
		},
		styles: {
			popGesture: 'close'
		}
	});
}
/*全局变量*/
var arry = {},
	count = 1,
	type = decodeURIComponent(GetLocationParam('type')),
	cont = decodeURIComponent(GetLocationParam('cont'));

var tiwen = $('#tiwen'),//体温
	xinlv = $('#xinlv'),//心率
	xueya = $('#xueya'),//血压
	weight = $('#weight'),//体重
	xuetang = $('#xuetang'),//血糖
	xueyang = $('#xueyang');//血氧
				
var	Tiwen = window.localStorage.getItem('tiwen'),
	Xinlv = window.localStorage.getItem('xinlv'),
	Xueya = window.localStorage.getItem('xueya'),
	Weight = window.localStorage.getItem('weight'),
	Xuetang = window.localStorage.getItem('xuetang'),
	Xueyang = window.localStorage.getItem('xueyang');
/*
 * ajax请求封装（获取列表数据）
 */
function jiaohu(url,data,callback){
	try {
	    $.ajax({
	        url:url,
	        type: "GET",
			async: false,
			dataType: "json",
			data: {
			  pageNo: count
			},
	        success:function(data){
	        	try {
							  			
				    if(data.code == 000){
				    	arry = data.data;
	
				    }else if(data.code == 001){
				    	mui.toast('请求出错'); 
				    }
				    
				    if(callback){//回调
				    	
				    	callback(data.data)
				    }
		  		} catch(e) {
			    
			    	mui.toast('获取数据失败');
		  		}
	        },
	        error: function(xhr, textStatus, error) {						
				if(textStatus == "error")
				mui.toast('请检查网络连接');
			}
	    });
	    
	}catch(e) {
	
	  mui.toast("请检查网络连接");
	
    }
}

/*
 * 性别验证
 */
function sexSe(sexs){
	
	var reg = /^[\u7537\u5973]+$/;
	if(sexs != "") {
		if(reg.test(sexs) === false) {
			mui.toast("性别只能输男/女");
			return false;
		}
	} else {
		mui.toast("性别不能为空");
		return false;
	}
	return true;
}

/*取*/
function _getItem(itemName){
	window.localStorage.getItem(itemName);
}

/*存*/
function _setItem(itemName,itemValue){
    if(itemValue==''){
        return;
    }
	window.localStorage.setItem(itemName,itemValue);
}







